/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2204 - C7
 * <p>Powered by webrx On 2022-09-07 16:19:18
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class C7 {
    static int n = 0;

    public static void main(String[] args) {
        var c = new C7();
        //c.m2(20);


        //c.m();

        //如下是输出

        //System.out.println(jiecheng(10));

    }

    public static int jiecheng(int n) {
        return n == 1 ? 1 : n * jiecheng(n - 1);
    }


    /**
    * 死循环递归
    */
    public void m() {
        ++n;
        System.out.println(n);
        m();
    }


    public void m2(int i) {
        System.out.println(i);
        if (++i < 20) {
            m2(i);
        }
    }
}
